package ast;

public class NewConstN extends Network{

	private Constant constant;
	private Network network;
	
	public NewConstN(Constant cst, Network n)
	{
		constant = cst;
		network = n;
	}
	
	public Constant getConstant()
	{
		return constant;
	}
	
	public Network getNetwork()
	{
		return network;
	}
	
	public void setNetwork(Network n)
	{
		network = n;
	}
	
	public String toString(int indent)
	{
		String res = "";
		res += "(new " + constant + " : ";
		if (constant instanceof DataConstant) {
			res += "Dt";
			indent += 2;
		} else {
			Label lb = ((ChannelConstant) constant).getLabel();
			res += lb;
			indent += lb.toString().length();
		}
		res += ")." + network.toString(0);
		return res;
	}
	
}
